<template>
	<view>
		
		<!-- <test v-if="flag"></test>
		
		<button type="primary" @click="checkTest">
			{{ flag ? '隐藏' : '显示' }}Test组件
		</button> -->
		
		<test :title="title" @myEven="getNum"></test>
		<!-- <test :title="title" @myEven="getNum"></test>
		这是子组件传递来到数据{{num}}
		<test-a></test-a>
		<test-b></test-b>
		<test-b></test-b> -->
		<uni-calendar
		:insert="true"
		:lunar="true"
		:start-date="'2019-3-2'"
		:end-date="'2019-5-20'"
		@change="change"
		></uni-calendar>
	</view>
	
</template>

<script>
	// 正确导入组件
	import test from '@/components/test.vue'
	import testA from'@/components/a.vue'
	import testB from'@/components/b.vue'
import testVue from '../../components/test.vue'
	import uniCalender from"@/uni_modules/uni-calendar/components/uni-calendar/uni-calendar.vue"
	
	export default {
		data() {
			return {
				flag: true  ,// 控制组件显示/隐藏
				title:'hello',
				num:0,
				name:'lsw'
			}
		},
		components: {
			test,  // 注册组件
			"test-a":testA,
			"test-b":testB,
			
		},
		methods: {
			checkTest() {
				this.flag = !this.flag
			},
			// 接收子组件传值的方法
			getNum(num) {
				console.log('接收到子组件的值:', num)
				this.num = num
			},
			change(e){
				console.log('触发了change',e)
			}
		},
		
	}

</script>